<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateVisitorRecordsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('visitor_records', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->smallInteger('media_id');
            $table->integer('position_id');
            $table->integer('activity_id');
            $table->enum('is_new', ['1', '2'])->default('2');
            $table->ipAddress('ip');
            $table->text('cookie', 64);
            $table->text('src', 12);
            $table->text('city', 50);
            $table->text('entrance', 100);
            $table->text('day', 10);
            $table->enum('terminal_type', ['1', '2', '3', '4', '5']);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('visitor_records');
    }
}
